package me.qi.kancha.service.base.support;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;

import java.util.List;

/**
 * @author sun
 * @date 2022/1/6 10:53
 * @modified By：
 */
@Data
public class PageData<T> {

    private long total;

    private Long unReadCount;

    private List<T> list;

    public PageData(long total, List<T> list) {
        this.total = total;
        this.list = list;
    }

    public PageData(Page<T> page) {
        this.list = page.getRecords();
        this.total = page.getTotal();
    }

    public PageData(Page<T> page,Long unReadCount) {
        this.list = page.getRecords();
        this.total = page.getTotal();
        this.unReadCount = unReadCount;
    }
}
